+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
+Sun Jun 24 11:29:35 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gdk/x11/gdkimage-x11.c (gdk_image_new): Fix stupid error
+ introduced last night that was making things decidedly not work.
+
+ * gtk/*.[ch]: Patch from Kristian Rietveld adding 80 getters
+ so that we have getter/setter pairing everywhere it makes
+ sense. (#55767)
+
+ * gtk/gtkradiobutton.[ch] gtk/gtktoolbar.c tests/testgtk.:
+ Rename gtk_radio_button_group to gtk_radio_button_get_group, add a
+ deprecated compat macro. (#55516)
+
+ * gtk/gtklabel.[ch]: Add functions
+ gtk_label_set/get_use_underline(), gtk_label_set/get_use_markup(),
+ gtk_label_set_label(), which mirror the property API for GtkLabel.
+ Make gtk_label_get_attributes() only reflect the attributes
+ set by gtk_label_set_attributes.
+
+ * gtk/gtknotebook.c (gtk_notebook_set_current_page) gtk/gtkcompat.h: Rename
+ from gtk_notebook_set_page().
+
Sat Jun 23 18:02:46 2001 Owen Taylor <otaylor@redhat.com>
* configure.in: Fix tests for XShm.h.
@Returns:
-<!-- ##### FUNCTION gtk_notebook_set_page ##### -->
+<!-- ##### MACRO gtk_notebook_set_page ##### -->
<para>
</para>
+<!-- # Unused Parameters # -->
@notebook:
@page_num:
@Returns: a new radio button.
-<!-- ##### FUNCTION gtk_radio_button_group ##### -->
+<!-- ##### MACRO gtk_radio_button_group ##### -->
<para>
Retrieves the group assigned to a radio button.
</para>
-@radio_button: a #GtkRadioButton.
@Returns: a linked list containing all the radio buttons in the same group
as @radio_button.
+<!-- # Unused Parameters # -->
+@radio_button: a #GtkRadioButton.
<!-- ##### FUNCTION gtk_radio_button_set_group ##### -->
image_list = g_list_prepend (image_list, image);
}
else
-#else /* !USE_SHM */
- goto error;
#endif /* USE_SHM */
+ goto error;
break;
case GDK_IMAGE_NORMAL:
private->ximage = XCreateImage (private->xdisplay, xvisual, visual->depth,
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/**
+ * gtk_accel_label_get_accel_widget:
+ * @accel_label: a #GtkAccelLabel
+ *
+ * Fetches the widget monitored by this accelerator label. See
+ * gtk_accel_label_set_accel_widget().
+ *
+ * Return value: the widget monitored by the accelerator label,
+ * or %NULL.
+ **/
+GtkWidget *
+gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label)
+{
+ g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), NULL);
+
+ return accel_label->accel_widget;
+}
+
guint
gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label)
{
GtkType gtk_accel_label_get_type (void) G_GNUC_CONST;
GtkWidget* gtk_accel_label_new (const gchar *string);
+GtkWidget* gtk_accel_label_get_accel_widget (GtkAccelLabel *accel_label);
guint gtk_accel_label_get_accel_width (GtkAccelLabel *accel_label);
void gtk_accel_label_set_accel_widget (GtkAccelLabel *accel_label,
GtkWidget *accel_widget);
return GTK_OBJECT (adjustment);
}
+/**
+ * gtk_adjustment_get_value:
+ * @adjustment: a #GtkAdjustment
+ *
+ * Gets the current value of the adjustment. See
+ * gtk_adjustment_set_value ().
+ *
+ * Return value: The current value of the adjustment.
+ **/
+gdouble
+gtk_adjustment_get_value (GtkAdjustment *adjustment)
+{
+ g_return_val_if_fail (GTK_IS_ADJUSTMENT (adjustment), 0.);
+
+ return adjustment->value;
+}
+
void
gtk_adjustment_set_value (GtkAdjustment *adjustment,
gdouble value)
void gtk_adjustment_clamp_page (GtkAdjustment *adjustment,
gdouble lower,
gdouble upper);
+gdouble gtk_adjustment_get_value (GtkAdjustment *adjustment);
void gtk_adjustment_set_value (GtkAdjustment *adjustment,
gdouble value);
}
}
+/**
+ * gtk_box_get_homogeneous:
+ * @box: a #GtkBox
+ *
+ * Returns whether the box is homogeneous (all children are the
+ * same size). See gtk_box_set_homogeneous ().
+ *
+ * Return value: %TRUE if the box is homogeneous.
+ **/
+gboolean
+gtk_box_get_homogeneous (GtkBox *box)
+{
+ g_return_val_if_fail (GTK_IS_BOX (box), FALSE);
+
+ return box->homogeneous;
+}
+
void
gtk_box_set_spacing (GtkBox *box,
gint spacing)
GtkWidget *widget);
void gtk_box_set_homogeneous (GtkBox *box,
gboolean homogeneous);
+gboolean gtk_box_get_homogeneous (GtkBox *box);
void gtk_box_set_spacing (GtkBox *box,
gint spacing);
gint gtk_box_get_spacing (GtkBox *box);
GtkType gtk_cell_renderer_toggle_get_type (void);
GtkCellRenderer *gtk_cell_renderer_toggle_new (void);
+gboolean gtk_cell_renderer_toggle_get_radio (GtkCellRendererToggle *toggle);
void gtk_cell_renderer_toggle_set_radio (GtkCellRendererToggle *toggle,
gboolean radio);
}
}
+/**
+ * gtk_check_menu_item_get_active:
+ * @check_menu_item: a #GtkCheckMenuItem
+ *
+ * Returns whether the check menu item is active. See
+ * gtk_check_menu_item_set_active ().
+ *
+ * Return value: %TRUE if the menu item is checked.
+ */
+gboolean
+gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item)
+{
+ g_return_val_if_fail (GTK_IS_CHECK_MENU_ITEM (check_menu_item), FALSE);
+
+ return check_menu_item->active;
+}
+
static void
gtk_check_menu_item_toggle_size_request (GtkMenuItem *menu_item,
gint *requisition)
GtkWidget* gtk_check_menu_item_new_with_mnemonic (const gchar *label);
void gtk_check_menu_item_set_active (GtkCheckMenuItem *check_menu_item,
gboolean is_active);
+gboolean gtk_check_menu_item_get_active (GtkCheckMenuItem *check_menu_item);
void gtk_check_menu_item_toggled (GtkCheckMenuItem *check_menu_item);
void gtk_check_menu_item_set_inconsistent (GtkCheckMenuItem *check_menu_item,
gboolean setting);
#define gtk_accel_label_accelerator_width gtk_accel_label_get_accel_width
#define gtk_container_border_width gtk_container_set_border_width
#define gtk_notebook_current_page gtk_notebook_get_current_page
+#define gtk_notebook_set_page gtk_notebook_set_current_page
#define gtk_packer_configure gtk_packer_set_child_packing
#define gtk_paned_gutter_size(p,s) (void) 0
#define gtk_paned_set_gutter_size(p,s) (void) 0
}
}
+/**
+ * gtk_container_get_border_width:
+ * @container: a #GtkContainer
+ *
+ * Retrieves the border width of the container. See
+ * gtk_container_set_border_width().
+ *
+ * Return value: the current border width
+ **/
+guint
+gtk_container_get_border_width (GtkContainer *container)
+{
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), 0);
+
+ return container->border_width;
+}
+
/**
* gtk_container_add:
* @container: a #GtkContainer
}
}
+/**
+ * gtk_container_get_resize_mode:
+ * @container: a #GtkContainer
+ *
+ * Returns the resize mode for the container. See
+ * gtk_container_set_resize_mode ().
+ *
+ * Return value: the current resize mode
+ **/
+GtkResizeMode
+gtk_container_get_resize_mode (GtkContainer *container)
+{
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), GTK_RESIZE_PARENT);
+
+ return container->resize_mode;
+}
+
void
gtk_container_set_reallocate_redraws (GtkContainer *container,
gboolean needs_redraws)
static GList*
get_focus_chain (GtkContainer *container)
{
- GList *chain;
-
- chain = g_object_get_data (G_OBJECT (container), "gtk-container-focus-chain");
-
- return chain;
+ return g_object_get_data (G_OBJECT (container), "gtk-container-focus-chain");
}
static GList*
*/
if (container->has_focus_chain)
{
- GList *chain;
-
- chain = get_focus_chain (container);
-
- children = g_list_copy (chain);
+ children = g_list_copy (get_focus_chain (container));
}
else
{
chain);
}
+/**
+ * gtk_container_get_focus_chain:
+ * @container: a #GtkContainer
+ * @focusable_widgets: location to store the focus chain of the
+ * container, or %NULL. You should free this list
+ * using g_list_free() when you are done with it, however
+ * no additional reference count is added to the
+ * individual widgets in the focus chain.
+ *
+ * Retrieve the focus chain of the container, if one has been
+ * set explicitely. If no focus chain has been explicitely
+ * set, GTK+ computes the focus chain based on the positions
+ * of the children. In that case, GTK+ stores %NULL in
+ * @focusable_widgets and returns %FALSE.
+ *
+ * Return value: %TRUE if the focus chain of the container,
+ * has been set explicitely.
+ **/
+gboolean
+gtk_container_get_focus_chain (GtkContainer *container,
+ GList **focus_chain)
+{
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
+
+ if (focus_chain)
+ {
+ if (container->has_focus_chain)
+ *focus_chain = g_list_copy (get_focus_chain (container));
+ else
+ *focus_chain = NULL;
+ }
+
+ return container->has_focus_chain;
+}
+
void
gtk_container_unset_focus_chain (GtkContainer *container)
{
(GtkDestroyNotify) gtk_object_unref);
}
+/**
+ * gtk_container_get_focus_vadjustment:
+ * @container: a #GtkContainer
+ *
+ * Retrieves the vertical focus adjustment for the container. See
+ * gtk_container_set_focus_vadjustment ().
+ *
+ * Return value: the vertical focus adjustment, or %NULL if
+ * none has been set.
+ **/
+GtkAdjustment *
+gtk_container_get_focus_vadjustment (GtkContainer *container)
+{
+ GtkAdjustment *vadjustment;
+
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
+
+ vadjustment = gtk_object_get_data_by_id (GTK_OBJECT (container),
+ vadjustment_key_id);
+
+ return vadjustment;
+}
+
void
gtk_container_set_focus_hadjustment (GtkContainer *container,
GtkAdjustment *adjustment)
(GtkDestroyNotify) gtk_object_unref);
}
+/**
+ * gtk_container_get_focus_hadjustment:
+ * @container: a #GtkContainer
+ *
+ * Retrieves the horizontal focus adjustment for the container. See
+ * gtk_container_set_focus_hadjustment ().
+ *
+ * Return value: the horizontal focus adjustment, or %NULL if none
+ * none has been set.
+ **/
+GtkAdjustment *
+gtk_container_get_focus_hadjustment (GtkContainer *container)
+{
+ GtkAdjustment *hadjustment;
+
+ g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
+
+ hadjustment = gtk_object_get_data_by_id (GTK_OBJECT (container),
+ hadjustment_key_id);
+
+ return hadjustment;
+}
+
static void
gtk_container_show_all (GtkWidget *widget)
GtkType gtk_container_get_type (void) G_GNUC_CONST;
void gtk_container_set_border_width (GtkContainer *container,
guint border_width);
+guint gtk_container_get_border_width (GtkContainer *container);
void gtk_container_add (GtkContainer *container,
GtkWidget *widget);
void gtk_container_remove (GtkContainer *container,
void gtk_container_set_resize_mode (GtkContainer *container,
GtkResizeMode resize_mode);
+GtkResizeMode gtk_container_get_resize_mode (GtkContainer *container);
void gtk_container_check_resize (GtkContainer *container);
void gtk_container_set_focus_chain (GtkContainer *container,
GList *focusable_widgets);
+gboolean gtk_container_get_focus_chain (GtkContainer *container,
+ GList **focusable_widgets);
void gtk_container_unset_focus_chain (GtkContainer *container);
/* Widget-level methods */
GtkWidget *child);
void gtk_container_set_focus_vadjustment (GtkContainer *container,
GtkAdjustment *adjustment);
+GtkAdjustment *gtk_container_get_focus_vadjustment (GtkContainer *container);
void gtk_container_set_focus_hadjustment (GtkContainer *container,
GtkAdjustment *adjustment);
+GtkAdjustment *gtk_container_get_focus_hadjustment (GtkContainer *container);
void gtk_container_resize_children (GtkContainer *container);
"editable", is_editable != FALSE,
NULL);
}
+
+/**
+ * gtk_editable_get_editable:
+ * @editable: a #GtkEditable
+ *
+ * Retrieves whether @editable is editable. See
+ * gtk_editable_set_editable().
+ *
+ * Return value: %TRUE if @editable is editable.
+ **/
+gboolean
+gtk_editable_get_editable (GtkEditable *editable)
+{
+ gboolean value;
+
+ g_return_val_if_fail (GTK_IS_EDITABLE (editable), FALSE);
+
+ gtk_object_get (GTK_OBJECT (editable), "editable", &value, NULL);
+
+ return value;
+}
gint gtk_editable_get_position (GtkEditable *editable);
void gtk_editable_set_editable (GtkEditable *editable,
gboolean is_editable);
+gboolean gtk_editable_get_editable (GtkEditable *editable);
#ifdef __cplusplus
}
gtk_entry_recompute (entry);
}
+/**
+ * gtk_entry_get_visibility:
+ * @entry: a #GtkEntry
+ *
+ * Retrieves whether the text in @entry is visible. See
+ * gtk_entry_set_visibility().
+ *
+ * Return value: %TRUE if the text is currently visible
+ **/
+gboolean
+gtk_entry_get_visibility (GtkEntry *entry)
+{
+ g_return_val_if_fail (GTK_IS_ENTRY (entry), FALSE);
+
+ return entry->visible;
+}
+
/**
* gtk_entry_set_invisible_char:
* @entry: a #GtkEntry
gtk_entry_recompute (entry);
}
+/**
+ * gtk_entry_get_invisible_char:
+ * @entry: a #GtkEntry
+ *
+ * Retrieves the character displayed in place of the real characters
+ * for entries with visisbility set to false. See gtk_entry_set_invisible_char().
+ *
+ * Return value: the current invisible char, or 0, if the entry does not
+ * show invisible text at all.
+ **/
+gunichar
+gtk_entry_get_invisible_char (GtkEntry *entry)
+{
+ g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
+
+ return entry->invisible_char;
+}
+
void
gtk_entry_set_editable(GtkEntry *entry,
gboolean editable)
g_object_notify (G_OBJECT (entry), "max_length");
}
+/**
+ * gtk_entry_get_max_length:
+ * @entry: a #GtkEntry
+ *
+ * Retrieves the maximum allowed length of the text in
+ * @entry. See gtk_entry_set_max_length().
+ *
+ * Return value: the maximum allowed number of characters
+ * in #GtkEntry, or 0 if there is no maximum.
+ **/
+gint
+gtk_entry_get_max_length (GtkEntry *entry)
+{
+ g_return_val_if_fail (GTK_IS_ENTRY (entry), 0);
+
+ return entry->text_max_length;
+}
+
/**
* gtk_entry_set_activates_default:
* @entry: a #GtkEntry
GtkWidget* gtk_entry_new (void);
void gtk_entry_set_visibility (GtkEntry *entry,
gboolean visible);
+gboolean gtk_entry_get_visibility (GtkEntry *entry);
void gtk_entry_set_invisible_char (GtkEntry *entry,
gunichar ch);
+gunichar gtk_entry_get_invisible_char (GtkEntry *entry);
void gtk_entry_set_editable (GtkEntry *entry,
gboolean editable);
void gtk_entry_set_has_frame (GtkEntry *entry,
/* text is truncated if needed */
void gtk_entry_set_max_length (GtkEntry *entry,
gint max);
+gint gtk_entry_get_max_length (GtkEntry *entry);
void gtk_entry_set_activates_default (GtkEntry *entry,
gboolean setting);
gboolean gtk_entry_get_activates_default (GtkEntry *entry);
g_object_notify (G_OBJECT (frame), "label_widget");
}
+/**
+ * gtk_frame_get_label_widget:
+ * @frame: a #GtkFrame
+ *
+ * Retrieves the label widget for the frame. See
+ * gtk_frame_set_label_widget().
+ *
+ * Return value: the label widget, or %NULL if there is none.
+ **/
+GtkWidget *
+gtk_frame_get_label_widget (GtkFrame *frame)
+{
+ g_return_val_if_fail (GTK_IS_FRAME (frame), NULL);
+
+ return frame->label_widget;
+}
+
void
gtk_frame_set_label_align (GtkFrame *frame,
gfloat xalign,
gtk_widget_queue_resize (GTK_WIDGET (frame));
}
+/**
+ * gtk_frame_get_label_align:
+ * @frame: a #GtkFrame
+ * @xalign: location to store X alignment of frame's label, or %NULL
+ * @yalign: location to store X alignment of frame's label, or %NULL
+ *
+ * Retrieves the X and Y alignment of the frame's label. See
+ * gtk_frame_set_label_align().
+ **/
+void
+gtk_frame_get_label_align (GtkFrame *frame,
+ gfloat *xalign,
+ gfloat *yalign)
+{
+ g_return_if_fail (GTK_IS_FRAME (frame));
+
+ if (xalign)
+ *xalign = frame->label_xalign;
+ if (yalign)
+ *yalign = frame->label_yalign;
+}
+
void
gtk_frame_set_shadow_type (GtkFrame *frame,
GtkShadowType type)
}
}
+/**
+ * gtk_frame_get_shadow_type:
+ * @frame: a #GtkFrame
+ *
+ * Retrieves the shadow type of the frame. See
+ * gtk_frame_set_shadow_type().
+ *
+ * Return value: the current shadow type of the frame.
+ **/
+GtkShadowType
+gtk_frame_get_shadow_type (GtkFrame *frame)
+{
+ g_return_val_if_fail (GTK_IS_FRAME (frame), GTK_SHADOW_ETCHED_IN);
+
+ return frame->shadow_type;
+}
+
static void
gtk_frame_paint (GtkWidget *widget,
GdkRectangle *area)
void gtk_frame_set_label_widget (GtkFrame *frame,
GtkWidget *label_widget);
+GtkWidget *gtk_frame_get_label_widget (GtkFrame *frame);
void gtk_frame_set_label_align (GtkFrame *frame,
gfloat xalign,
gfloat yalign);
+void gtk_frame_get_label_align (GtkFrame *frame,
+ gfloat *xalign,
+ gfloat *yalign);
void gtk_frame_set_shadow_type (GtkFrame *frame,
GtkShadowType type);
+GtkShadowType gtk_frame_get_shadow_type (GtkFrame *frame);
#ifdef __cplusplus
}
_("Snap edge"),
_("Side of the handlebox that's lined up with the docking point to dock the handlebox."),
GTK_TYPE_POSITION_TYPE,
- GTK_POS_LEFT,
+ GTK_POS_TOP,
G_PARAM_READABLE | G_PARAM_WRITABLE));
object_class->destroy = gtk_handle_box_destroy;
}
}
+/**
+ * gtk_handle_box_get_shadow_type:
+ * @handle_box: a #GtkHandleBox
+ *
+ * Gets the type of shadow drawn around the handle box. See
+ * gtk_handle_box_set_shadow_type().
+ *
+ * Return value: the type of shadow currently drawn around the handle box.
+ **/
+GtkShadowType
+gtk_handle_box_get_shadow_type (GtkHandleBox *handle_box)
+{
+ g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), GTK_SHADOW_ETCHED_OUT);
+
+ return handle_box->shadow_type;
+}
+
void
gtk_handle_box_set_handle_position (GtkHandleBox *handle_box,
GtkPositionType position)
}
}
+/**
+ * gtk_handle_box_get_handle_position:
+ * @handle_box: a #GtkHandleBox
+ *
+ * Gets the handle position of the handle box. See
+ * gtk_handle_box_set_handle_position().
+ *
+ * Return value: the current handle position.
+ **/
+GtkPositionType
+gtk_handle_box_get_handle_position (GtkHandleBox *handle_box)
+{
+ g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), GTK_POS_LEFT);
+
+ return handle_box->handle_position;
+}
+
void
gtk_handle_box_set_snap_edge (GtkHandleBox *handle_box,
GtkPositionType edge)
}
}
+/**
+ * gtk_handle_box_get_snap_edge:
+ * @handle_box: a #GtkHandleBox
+ *
+ * Gets the edge used for determining reattachment of the handle box. See
+ * gtk_handle_box_set_snap_edge().
+ *
+ * Return value: the edge used for determining reattachment, or (GtkPositionType)-1 if this
+ * is determined (as per default) from the handle position.
+ **/
+GtkPositionType
+gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box)
+{
+ g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), (GtkPositionType)-1);
+
+ return handle_box->snap_edge;
+}
+
static void
gtk_handle_box_paint (GtkWidget *widget,
GdkEventExpose *event,
};
-GtkType gtk_handle_box_get_type (void) G_GNUC_CONST;
-GtkWidget* gtk_handle_box_new (void);
-void gtk_handle_box_set_shadow_type (GtkHandleBox *handle_box,
- GtkShadowType type);
-void gtk_handle_box_set_handle_position (GtkHandleBox *handle_box,
- GtkPositionType position);
-void gtk_handle_box_set_snap_edge (GtkHandleBox *handle_box,
- GtkPositionType edge);
+GtkType gtk_handle_box_get_type (void) G_GNUC_CONST;
+GtkWidget* gtk_handle_box_new (void);
+void gtk_handle_box_set_shadow_type (GtkHandleBox *handle_box,
+ GtkShadowType type);
+GtkShadowType gtk_handle_box_get_shadow_type (GtkHandleBox *handle_box);
+void gtk_handle_box_set_handle_position (GtkHandleBox *handle_box,
+ GtkPositionType position);
+GtkPositionType gtk_handle_box_get_handle_position(GtkHandleBox *handle_box);
+void gtk_handle_box_set_snap_edge (GtkHandleBox *handle_box,
+ GtkPositionType edge);
+GtkPositionType gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box);
switch (prop_id)
{
case PROP_LABEL:
- gtk_label_set_label_internal (label,
- g_strdup (g_value_get_string (value)));
- gtk_label_recalculate (label);
- if (last_keyval != label->mnemonic_keyval)
- gtk_label_setup_mnemonic (label, last_keyval);
+ gtk_label_set_label (label, g_value_get_string (value));
break;
case PROP_ATTRIBUTES:
gtk_label_set_attributes (label, g_value_get_boxed (value));
break;
case PROP_USE_MARKUP:
- gtk_label_set_use_markup_internal (label, g_value_get_boolean (value));
- gtk_label_recalculate (label);
+ gtk_label_set_use_markup (label, g_value_get_boolean (value));
break;
case PROP_USE_UNDERLINE:
- gtk_label_set_use_underline_internal (label, g_value_get_boolean (value));
- gtk_label_recalculate (label);
- if (label->use_underline)
- gtk_label_setup_mnemonic (label, last_keyval);
+ gtk_label_set_use_underline (label, g_value_get_boolean (value));
break;
case PROP_JUSTIFY:
gtk_label_set_justify (label, g_value_get_enum (value));
/**
* gtk_label_new:
* @str: The text of the label
- * @returns: a new #GtkLabel
*
* Creates a new #GtkLabel, containing the text in @str.
+ *
+ * Return value: the new #GtkLabel
**/
GtkWidget*
gtk_label_new (const gchar *str)
* gtk_label_new_with_mnemonic:
* @str: The text of the label, with an underscore in front of the
* mnemonic character
- * @returns: a new #GtkLabel
*
* Creates a new #GtkLabel, containing the text in @str.
*
* label is inside a button or menu item, the button or menu item will
* automatically become the mnemonic widget and be activated by
* the mnemonic.
+ *
+ * Return value: the new #GtkLabel
**/
GtkWidget*
gtk_label_new_with_mnemonic (const gchar *str)
gtk_widget_ref (label->mnemonic_widget);
}
+/**
+ * gtk_label_get_mnemonic_widget:
+ * @label: a #GtkLabel
+ *
+ * Retrieves the target of the mnemonic (keyboard shortcut) of this
+ * label. See gtk_label_set_mnemonic_widget ().
+ *
+ * Return value: the target of the label's mnemonic, or %NULL if none
+ * has been set and the default algorithm will be used.
+ **/
+GtkWidget *
+gtk_label_get_mnemonic_widget (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), NULL);
+
+ return label->mnemonic_widget;
+}
/**
* gtk_label_get_mnemonic_keyval:
static void
gtk_label_set_use_markup_internal (GtkLabel *label,
- gboolean val)
+ gboolean val)
{
val = val != FALSE;
if (label->use_markup != val)
- g_object_notify (G_OBJECT (label), "use_markup");
- label->use_markup = val;
+ {
+ g_object_notify (G_OBJECT (label), "use_markup");
+ label->use_markup = val;
+ }
}
static void
{
val = val != FALSE;
if (label->use_underline != val)
- g_object_notify (G_OBJECT (label), "use_underline");
- label->use_underline = val;
+ {
+ g_object_notify (G_OBJECT (label), "use_underline");
+ label->use_underline = val;
+ }
}
static void
-gtk_label_set_attributes_internal (GtkLabel *label,
- PangoAttrList *attrs)
+gtk_label_set_attributes_internal (GtkLabel *label,
+ PangoAttrList *attrs)
{
if (attrs)
pango_attr_list_ref (attrs);
if (label->attrs)
pango_attr_list_unref (label->attrs);
+ if (!label->use_markup && !label->use_underline)
+ {
+ pango_attr_list_ref (attrs);
+ if (label->effective_attrs)
+ pango_attr_list_unref (label->effective_attrs);
+ label->effective_attrs = attrs;
+ }
+
label->attrs = attrs;
g_object_notify (G_OBJECT (label), "attributes");
}
gtk_label_recalculate (GtkLabel *label)
{
if (label->use_markup)
- set_markup (label, label->label, label->use_underline);
+ set_markup (label, label->label, label->use_underline);
else
{
if (label->use_underline)
else
{
gtk_label_set_text_internal (label, g_strdup (label->label));
- gtk_label_set_attributes_internal (label, NULL);
+ if (label->attrs)
+ pango_attr_list_ref (label->attrs);
+ if (label->effective_attrs)
+ pango_attr_list_unref (label->effective_attrs);
+ label->effective_attrs = label->attrs;
}
}
* @attrs: a #PangoAttrList
*
* Sets a #PangoAttrList; the attributes in the list are applied to the
- * label text.
+ * label text. The attributes set with this function will be ignored
+ * if label->use_underline or label->use_markup is %TRUE.
**/
void
gtk_label_set_attributes (GtkLabel *label,
gtk_widget_queue_resize (GTK_WIDGET (label));
}
+/**
+ * gtk_label_get_attributes:
+ * @label: a #GtkLabel
+ *
+ * Gets the attribute list that was set on the label using
+ * gtk_label_set_attributes(), if any. This function does
+ * not reflect attributes that come from the labels markup
+ * (see gtk_label_set_markup()). If you want to get the
+ * effective attributes for the label, use
+ * pango_layout_get_attribute (gtk_label_get_layout (label)).
+ *
+ * Return value: the attribute list, or %NULL if none was set.
+ **/
+PangoAttrList *
+gtk_label_get_attributes (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), NULL);
+
+ return label->attrs;
+}
+
+/**
+ * gtk_label_set_label:
+ * @label: a #GtkLabel
+ * @str: the new text to set for the label
+ *
+ * Sets the text of the label. The label is interpreted as
+ * including embedded underlines and/or Pango markup depending
+ * on the values of label->use_underline and label->use_markup.
+ **/
+void
+gtk_label_set_label (GtkLabel *label,
+ const gchar *str)
+{
+ guint last_keyval;
+
+ g_return_if_fail (GTK_IS_LABEL (label));
+ g_return_if_fail (str != NULL);
+
+ last_keyval = label->mnemonic_keyval;
+
+ gtk_label_set_label_internal (label, g_strdup (str));
+ gtk_label_recalculate (label);
+ if (last_keyval != label->mnemonic_keyval)
+ gtk_label_setup_mnemonic (label, last_keyval);
+}
+
+/**
+ * gtk_label_get_label:
+ * @label: a #GtkLabel
+ *
+ * Fetches the text from a label widget including any embedded
+ * underlines indicating mnemonics and Pango markup. (See
+ * gtk_label_get_text ()).
+ *
+ * Return value: the text of the label widget. This string is
+ * owned by the widget and must not be modified or freed.
+ **/
+G_CONST_RETURN gchar *
+gtk_label_get_label (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), NULL);
+
+ return label->label;
+}
+
static void
set_markup (GtkLabel *label,
const gchar *str,
if (attrs)
{
- gtk_label_set_attributes_internal (label, attrs);
- pango_attr_list_unref (attrs);
+ if (label->effective_attrs)
+ pango_attr_list_unref (label->effective_attrs);
+ label->effective_attrs = attrs;
}
if (accel_char != 0)
* gtk_label_get_text:
* @label: a #GtkLabel
*
- * Fetches the text from a label widget
+ * Fetches the text from a label widget, as displayed on the
+ * screen. This does not include any embedded underlines
+ * indicating mnemonics or Pango markup. (See gtk_label_get_label())
*
* Return value: the text in the label widget. This is the internal
- * string used by the label, and must not be modified.
+ * string used by the label, and must not be modified.
**/
G_CONST_RETURN gchar *
gtk_label_get_text (GtkLabel *label)
g_return_if_fail (GTK_IS_LABEL (label));
attrs = gtk_label_pattern_to_attrs (label, pattern);
-
gtk_label_set_attributes_internal (label, attrs);
}
}
+/**
+ * gtk_label_set_justify:
+ * @label: a #GtkLabel
+ * @jtype: a #GtkJustification
+ *
+ * Sets the alignment of the lines in the text of the label relative to
+ * each other.
+ **/
void
gtk_label_set_justify (GtkLabel *label,
GtkJustification jtype)
}
}
+/**
+ * gtk_label_get_justify:
+ * @label: a #GtkLabel
+ *
+ * Returns the justification of the label. See gtk_label_set_justification ().
+ *
+ * Return value: GtkJustification
+ **/
+GtkJustification
+gtk_label_get_justify (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), 0);
+
+ return label->jtype;
+}
+
+/**
+ * gtk_label_set_line_wrap:
+ * @label: a #GtkLabel
+ * @wrap: the setting
+ *
+ * If true, the lines will be wrapped if the text becomes too wide.
+ */
void
gtk_label_set_line_wrap (GtkLabel *label,
gboolean wrap)
}
}
+/**
+ * gtk_label_get_line_wrap:
+ * @label: a #GtkLabel
+ *
+ * Returns whether lines in the label are automatically wrapped. See gtk_label_set_line_wrap ().
+ *
+ * Return value: %TRUE if the lines of the label are automatically wrapped.
+ */
+gboolean
+gtk_label_get_line_wrap (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), FALSE);
+
+ return label->wrap;
+}
+
void
gtk_label_get (GtkLabel *label,
gchar **str)
if (label->attrs)
pango_attr_list_unref (label->attrs);
+ if (label->effective_attrs)
+ pango_attr_list_unref (label->attrs);
+
g_free (label->select_info);
G_OBJECT_CLASS (parent_class)->finalize (object);
label->layout = gtk_widget_create_pango_layout (widget, label->text);
- if (label->attrs)
- pango_layout_set_attributes (label->layout, label->attrs);
+ if (label->effective_attrs)
+ pango_layout_set_attributes (label->layout, label->effective_attrs);
switch (label->jtype)
{
get_layout_location (label, x, y);
}
+/**
+ * gtk_label_set_use_markup:
+ * @label: a #GtkLabel
+ * @setting: %TRUE if the label's text should be parsed for markup.
+ *
+ * Sets whether the text of the label contains markup in Pango's
+ * text markup lango. See gtk_label_set_markup().
+ **/
+void
+gtk_label_set_use_markup (GtkLabel *label,
+ gboolean setting)
+{
+ g_return_if_fail (GTK_IS_LABEL (label));
+
+ gtk_label_set_use_markup_internal (label, setting);
+ gtk_label_recalculate (label);
+}
+
+/**
+ * gtk_label_get_use_markup:
+ * @label: a #GtkLabel
+ *
+ * Returns whether the label's text is interpreted as marked up with the
+ * Pango text markup language. See gtk_label_set_use_markup ().
+ *
+ * Return value: %TRUE if the label's text will be parsed for markup.
+ **/
+gboolean
+gtk_label_get_use_markup (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), FALSE);
+
+ return label->use_markup;
+}
+
+/**
+ * gtk_label_set_use_underline:
+ * @label: a #GtkLabel
+ * @setting: %TRUE if underlines in the text indicate mnemonics
+ *
+ * If true, an underline in the text indicates the next character should be
+ * used for the mnemonic accelerator key.
+ */
+void
+gtk_label_set_use_underline (GtkLabel *label,
+ gboolean setting)
+{
+ g_return_if_fail (GTK_IS_LABEL (label));
+
+ gtk_label_set_use_underline_internal (label, setting);
+ gtk_label_recalculate (label);
+ if (label->use_underline)
+ gtk_label_setup_mnemonic (label, label->mnemonic_keyval);
+}
+
+/**
+ * gtk_label_get_use_underline:
+ * @label: a #GtkLabel
+ *
+ * Returns whether an embedded underline in thef label indicates a
+ * mnemonic. See gtk_label_set_use_underline ().
+ *
+ * Return value: %TRUE whether an embedded underline in the label indicates
+ * the mnemonic accelerator keys.
+ **/
+gboolean
+gtk_label_get_use_underline (GtkLabel *label)
+{
+ g_return_val_if_fail (GTK_IS_LABEL (label), FALSE);
+
+ return label->use_underline;
+}
gchar *text;
PangoAttrList *attrs;
+ PangoAttrList *effective_attrs;
PangoLayout *layout;
};
GtkType gtk_label_get_type (void) G_GNUC_CONST;
-GtkWidget* gtk_label_new (const char *str);
-GtkWidget* gtk_label_new_with_mnemonic (const char *str);
-void gtk_label_set_text (GtkLabel *label,
- const char *str);
-G_CONST_RETURN gchar* gtk_label_get_text (GtkLabel *label);
-void gtk_label_set_attributes (GtkLabel *label,
- PangoAttrList *attrs);
-void gtk_label_set_markup (GtkLabel *label,
- const gchar *str);
+GtkWidget* gtk_label_new (const char *str);
+GtkWidget* gtk_label_new_with_mnemonic (const char *str);
+void gtk_label_set_text (GtkLabel *label,
+ const char *str);
+G_CONST_RETURN gchar* gtk_label_get_text (GtkLabel *label);
+void gtk_label_set_attributes (GtkLabel *label,
+ PangoAttrList *attrs);
+PangoAttrList *gtk_label_get_attributes (GtkLabel *label);
+void gtk_label_set_label (GtkLabel *label,
+ const gchar *str);
+G_CONST_RETURN gchar *gtk_label_get_label (GtkLabel *label);
+void gtk_label_set_markup (GtkLabel *label,
+ const gchar *str);
+void gtk_label_set_use_markup (GtkLabel *label,
+ gboolean setting);
+gboolean gtk_label_get_use_markup (GtkLabel *label);
+void gtk_label_set_use_underline (GtkLabel *label,
+ gboolean setting);
+gboolean gtk_label_get_use_underline (GtkLabel *label);
+
void gtk_label_set_markup_with_mnemonic (GtkLabel *label,
const gchar *str);
guint gtk_label_get_mnemonic_keyval (GtkLabel *label);
void gtk_label_set_mnemonic_widget (GtkLabel *label,
GtkWidget *widget);
+GtkWidget *gtk_label_get_mnemonic_widget (GtkLabel *label);
void gtk_label_set_text_with_mnemonic (GtkLabel *label,
const gchar *str);
void gtk_label_set_justify (GtkLabel *label,
GtkJustification jtype);
+GtkJustification gtk_label_get_justify (GtkLabel *label);
void gtk_label_set_pattern (GtkLabel *label,
const gchar *pattern);
void gtk_label_set_line_wrap (GtkLabel *label,
gboolean wrap);
+gboolean gtk_label_get_line_wrap (GtkLabel *label);
void gtk_label_set_selectable (GtkLabel *label,
gboolean setting);
gboolean gtk_label_get_selectable (GtkLabel *label);
gint *y);
-
#ifndef GTK_DISABLE_COMPAT_H
# define gtk_label_set gtk_label_set_text
#endif /* GTK_DISABLE_COMPAT_H */
}
}
+/**
+ * gtk_layout_get_size:
+ * @layout: a #GtkLayout
+ * @width: location to store the width set on @layout, or %NULL
+ * @height: location to store the height set on @layout, or %NULL
+ *
+ * Gets the size that has been set on the layout, and that determines
+ * the total extents of the layout's scrollbar area. See
+ * gtk_layout_set_size ().
+ **/
+void
+gtk_layout_get_size (GtkLayout *layout,
+ guint *width,
+ guint *height)
+{
+ g_return_if_fail (GTK_IS_LAYOUT (layout));
+
+ if (width)
+ *width = layout->width;
+ if (height)
+ *height = layout->height;
+}
+
void
gtk_layout_freeze (GtkLayout *layout)
{
void gtk_layout_set_size (GtkLayout *layout,
guint width,
guint height);
+void gtk_layout_get_size (GtkLayout *layout,
+ guint *width,
+ guint *height);
GtkAdjustment* gtk_layout_get_hadjustment (GtkLayout *layout);
GtkAdjustment* gtk_layout_get_vadjustment (GtkLayout *layout);
}
}
+/**
+ * gtk_menu_get_tearoff_state:
+ * @menu: a #GtkMenu
+ *
+ * Returns whether the menu is torn off. See
+ * gtk_menu_set_tearoff_state ().
+ *
+ * Return value: %TRUE if the menu is currently torn off.
+ **/
+gboolean
+gtk_menu_get_tearoff_state (GtkMenu *menu)
+{
+ g_return_val_if_fail (GTK_IS_MENU (menu), FALSE);
+
+ return menu->torn_off;
+}
+
void
gtk_menu_set_title (GtkMenu *menu,
const gchar *title)
g_strdup (title), (GtkDestroyNotify) g_free);
}
+/**
+ * gtk_menu_get_title:
+ * @menu: a #GtkMenu
+ *
+ * Returns the title of the menu. See gtk_menu_set_title().
+ *
+ * Return value: the title of the menu, or %NULL if the menu has no
+ * title set on it.
+ **/
+G_CONST_RETURN gchar *
+gtk_menu_get_title (GtkMenu *menu)
+{
+ g_return_val_if_fail (GTK_IS_MENU (menu), NULL);
+
+ return gtk_object_get_data (GTK_OBJECT (menu), "gtk-menu-title");
+}
+
void
gtk_menu_reorder_child (GtkMenu *menu,
GtkWidget *child,
void gtk_menu_set_tearoff_state (GtkMenu *menu,
gboolean torn_off);
+gboolean gtk_menu_get_tearoff_state (GtkMenu *menu);
/* This sets the window manager title for the window that
* appears when a menu is torn off
*/
void gtk_menu_set_title (GtkMenu *menu,
const gchar *title);
+G_CONST_RETURN gchar *gtk_menu_get_title (GtkMenu *menu);
void gtk_menu_reorder_child (GtkMenu *menu,
GtkWidget *child,
}
}
+/**
+ * gtk_menu_item_get_submenu:
+ * @menu_item: a #GtkMenuItem
+ *
+ * Gets the submenu underneath this menu item, if any. See
+ * gtk_menu_item_set_submenu().
+ *
+ * Return value: submenu for this menu item, or %NULL if none.
+ **/
+GtkWidget *
+gtk_menu_item_get_submenu (GtkMenuItem *menu_item)
+{
+ g_return_val_if_fail (GTK_IS_MENU_ITEM (menu_item), NULL);
+
+ return menu_item->submenu;
+}
+
void
gtk_menu_item_remove_submenu (GtkMenuItem *menu_item)
{
GtkWidget* gtk_menu_item_new_with_mnemonic (const gchar *label);
void gtk_menu_item_set_submenu (GtkMenuItem *menu_item,
GtkWidget *submenu);
+GtkWidget* gtk_menu_item_get_submenu (GtkMenuItem *menu_item);
void gtk_menu_item_remove_submenu (GtkMenuItem *menu_item);
void gtk_menu_item_set_placement (GtkMenuItem *menu_item,
GtkSubmenuPlacement placement);
}
}
+/**
+ * gtk_misc_get_alignment:
+ * @misc: a #GtkMisc
+ * @xalign: location to store X alignment of @misc, or %NULL
+ * @yalign: location to store Y alignment of @misc, or %NULL
+ *
+ * Gets the X and Y alignment of the widget within its allocation. See
+ * gtk_misc_set_alignment().
+ **/
+void
+gtk_misc_get_alignment (GtkMisc *misc,
+ gfloat *xalign,
+ gfloat *yalign)
+{
+ g_return_if_fail (GTK_IS_MISC (misc));
+
+ if (xalign)
+ *xalign = misc->xalign;
+ if (yalign)
+ *yalign = misc->yalign;
+}
+
void
gtk_misc_set_padding (GtkMisc *misc,
gint xpad,
}
}
+/**
+ * gtk_misc_get_padding:
+ * @misc: a #GtkMisc
+ * @xpad: location to store padding in the X direction, or %NULL
+ * @ypad: location to store padding in the Y direction, or %NULL
+ *
+ * Gets the padding in the X and Y directions of the widget. See gtk_misc_set_padding().
+ **/
+void
+gtk_misc_get_padding (GtkMisc *misc,
+ gint *xpad,
+ gint *ypad)
+{
+ g_return_if_fail (GTK_IS_MISC (misc));
+
+ if (xpad)
+ *xpad = misc->xpad;
+ if (ypad)
+ *ypad = misc->ypad;
+}
+
static void
gtk_misc_realize (GtkWidget *widget)
{
void gtk_misc_set_alignment (GtkMisc *misc,
gfloat xalign,
gfloat yalign);
+void gtk_misc_get_alignment (GtkMisc *misc,
+ gfloat *xalign,
+ gfloat *yalign);
void gtk_misc_set_padding (GtkMisc *misc,
gint xpad,
gint ypad);
+void gtk_misc_get_padding (GtkMisc *misc,
+ gint *xpad,
+ gint *ypad);
#ifdef __cplusplus
gtk_notebook_set_homogeneous_tabs (notebook, g_value_get_boolean (value));
break;
case PROP_PAGE:
- gtk_notebook_set_page (notebook, g_value_get_int (value));
+ gtk_notebook_set_current_page (notebook, g_value_get_int (value));
break;
case PROP_TAB_POS:
gtk_notebook_set_tab_pos (notebook, g_value_get_enum (value));
/* Public GtkNotebook Page Switch Methods :
* gtk_notebook_get_current_page
* gtk_notebook_page_num
- * gtk_notebook_set_page
+ * gtk_notebook_set_current_page
* gtk_notebook_next_page
* gtk_notebook_prev_page
*/
}
/**
- * gtk_notebook_set_page:
+ * gtk_notebook_set_current_page:
* @notebook: a #GtkNotebook
* @page_num: index of the page to switch to, starting from 0.
* If negative, or greater than the number of pages
* Switches to the page number @page_num.
**/
void
-gtk_notebook_set_page (GtkNotebook *notebook,
- gint page_num)
+gtk_notebook_set_current_page (GtkNotebook *notebook,
+ gint page_num)
{
GList *list;
}
}
+/**
+ * gtk_notebook_get_show_border:
+ * @notebook: a #GtkNotebook
+ *
+ * Returns whether a bevel will be drawn around the notebook pages. See
+ * gtk_notebook_set_show_border().
+ *
+ * Return value: %TRUE if the bevel is drawn
+ **/
+gboolean
+gtk_notebook_get_show_border (GtkNotebook *notebook)
+{
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
+
+ return notebook->show_border;
+}
+
/**
* gtk_notebook_set_show_tabs:
* @notebook: a #GtkNotebook
g_object_notify (G_OBJECT (notebook), "show_tabs");
}
+/**
+ * gtk_notebook_get_show_tabs:
+ * @notebook: a #GtkNotebook
+ *
+ * Returns whether the tabs of the notebook are shown. See
+ * gtk_notebook_set_show_tabs().
+ *
+ * Return value: %TRUE if the tabs are shown
+ **/
+gboolean
+gtk_notebook_get_show_tabs (GtkNotebook *notebook)
+{
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
+
+ return notebook->show_tabs;
+}
+
/**
* gtk_notebook_set_tab_pos:
* @notebook:
g_object_notify (G_OBJECT (notebook), "tab_pos");
}
+/**
+ * gtk_notebook_get_tab_pos:
+ * @notebook: a #GtkNotebook
+ *
+ * Gets the edge at which the tabs for switching pages in the
+ * notebook are drawn.
+ *
+ * Return value: the edge at which the tabs are drawn
+ **/
+GtkPositionType
+gtk_notebook_get_tab_pos (GtkNotebook *notebook)
+{
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), GTK_POS_TOP);
+
+ return notebook->tab_pos;
+}
+
/**
* gtk_notebook_set_homogeneous_tabs:
* @notebook: a #GtkNotebook
}
}
+/**
+ * gtk_notebook_get_scrollable:
+ * @notebook: a #GtkNotebook
+ *
+ * Returns whether the tab label area has arrows for scrolling. See
+ * gtk_notebook_set_scrollable().
+ *
+ * Return value: %TRUE if arrows for scrolling are present
+ **/
+gboolean
+gtk_notebook_get_scrollable (GtkNotebook *notebook)
+{
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), FALSE);
+
+ return notebook->scrollable;
+}
+
/* Public GtkNotebook Popup Menu Methods:
*
* gtk_notebook_popup_enable
gtk_widget_child_notify (child, "tab_label");
}
+/**
+ * gtk_notebook_get_tab_label_text:
+ * @notebook: a #GtkNotebook
+ * @child: a widget contained in a page of @notebook
+ *
+ * Retrieves the text of the tab label for the page containing
+ * @child.
+ *
+ * Returns value: the text of the tab label, or %NULL if the
+ * tab label widget is not a #GtkLabel. The
+ * string is owned by the widget and must not
+ * be freed.
+ **/
+G_CONST_RETURN gchar *
+gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
+ GtkWidget *child)
+{
+ GtkWidget *tab_label;
+
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
+
+ tab_label = gtk_notebook_get_tab_label (notebook, child);
+
+ if (tab_label && GTK_IS_LABEL (tab_label))
+ return gtk_label_get_text (GTK_LABEL (tab_label));
+ else
+ return NULL;
+}
+
/**
* gtk_notebook_get_menu_label:
* @notebook: a #GtkNotebook
- * @child: the page
+ * @child: a widget contained in a page of @notebook
*
- * Returns the menu label of the page containing @child. NULL is
- * returned if @child is not in @notebook or NULL if it has the
- * default menu label.
+ * Retrieves the menu label widget of the page containing @child.
*
- * Return value: the menu label
+ * Return value: the menu label, or %NULL if the
+ * notebook page does not have a menu label other
+ * than the default (the tab label).
**/
GtkWidget*
gtk_notebook_get_menu_label (GtkNotebook *notebook,
gtk_widget_child_notify (child, "menu_label");
}
+/**
+ * gtk_notebook_get_menu_label_text:
+ * @notebook: a #GtkNotebook
+ * @child: the child widget of a page of the notebook.
+ *
+ * Retrieves the text of the menu label for the page containing
+ * @child.
+ *
+ * Returns value: the text of the tab label, or %NULL if the
+ * widget does not have a menu label other than
+ * the default menu label, or the menu label widget
+ * is not a #GtkLabel. The string is owned by
+ * the widget and must not be freed.
+ **/
+G_CONST_RETURN gchar *
+gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
+ GtkWidget *child)
+{
+ GtkWidget *menu_label;
+
+ g_return_val_if_fail (GTK_IS_NOTEBOOK (notebook), NULL);
+ g_return_val_if_fail (GTK_IS_WIDGET (child), NULL);
+
+ menu_label = gtk_notebook_get_menu_label (notebook, child);
+
+ if (menu_label && GTK_IS_LABEL (menu_label))
+ return gtk_label_get_text (GTK_LABEL (menu_label));
+ else
+ return NULL;
+}
+
/* Helper function called when pages are reordered
*/
static void
gint page_num);
gint gtk_notebook_page_num (GtkNotebook *notebook,
GtkWidget *child);
-void gtk_notebook_set_page (GtkNotebook *notebook,
+void gtk_notebook_set_current_page (GtkNotebook *notebook,
gint page_num);
void gtk_notebook_next_page (GtkNotebook *notebook);
void gtk_notebook_prev_page (GtkNotebook *notebook);
* set Notebook, NotebookTab style *
***********************************************************/
-void gtk_notebook_set_show_border (GtkNotebook *notebook,
- gboolean show_border);
-void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
- gboolean show_tabs);
-void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
- GtkPositionType pos);
-void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
- gboolean homogeneous);
-void gtk_notebook_set_tab_border (GtkNotebook *notebook,
- guint border_width);
-void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
- guint tab_hborder);
-void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
- guint tab_vborder);
-void gtk_notebook_set_scrollable (GtkNotebook *notebook,
- gboolean scrollable);
+void gtk_notebook_set_show_border (GtkNotebook *notebook,
+ gboolean show_border);
+gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
+void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
+ gboolean show_tabs);
+gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
+void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
+ GtkPositionType pos);
+GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
+
+#ifndef GTK_DISABLE_DEPRECATED
+void gtk_notebook_set_homogeneous_tabs (GtkNotebook *notebook,
+ gboolean homogeneous);
+void gtk_notebook_set_tab_border (GtkNotebook *notebook,
+ guint border_width);
+void gtk_notebook_set_tab_hborder (GtkNotebook *notebook,
+ guint tab_hborder);
+void gtk_notebook_set_tab_vborder (GtkNotebook *notebook,
+ guint tab_vborder);
+#endif /* GTK_DISABLE_DEPRECATED */
+
+void gtk_notebook_set_scrollable (GtkNotebook *notebook,
+ gboolean scrollable);
+gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
/***********************************************************
* enable/disable PopupMenu *
void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
GtkWidget *child,
const gchar *tab_text);
+G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
+ GtkWidget *child);
GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
GtkWidget *child);
void gtk_notebook_set_menu_label (GtkNotebook *notebook,
void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
GtkWidget *child,
const gchar *menu_text);
+G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
+ GtkWidget *child);
void gtk_notebook_query_tab_label_packing (GtkNotebook *notebook,
GtkWidget *child,
gboolean *expand,
case ARG_GROUP:
if (GTK_VALUE_OBJECT (*arg))
- slist = gtk_radio_button_group ((GtkRadioButton*) GTK_VALUE_OBJECT (*arg));
+ slist = gtk_radio_button_get_group ((GtkRadioButton*) GTK_VALUE_OBJECT (*arg));
else
slist = NULL;
gtk_radio_button_set_group (radio_button, slist);
{
GSList *l = NULL;
if (group)
- l = gtk_radio_button_group (group);
+ l = gtk_radio_button_get_group (group);
return gtk_radio_button_new (l);
}
{
GSList *l = NULL;
if (group)
- l = gtk_radio_button_group (group);
+ l = gtk_radio_button_get_group (group);
return gtk_radio_button_new_with_label (l, label);
}
{
GSList *l = NULL;
if (group)
- l = gtk_radio_button_group (group);
+ l = gtk_radio_button_get_group (group);
return gtk_radio_button_new_with_mnemonic (l, label);
}
GSList*
-gtk_radio_button_group (GtkRadioButton *radio_button)
+gtk_radio_button_get_group (GtkRadioButton *radio_button)
{
g_return_val_if_fail (radio_button != NULL, NULL);
g_return_val_if_fail (GTK_IS_RADIO_BUTTON (radio_button), NULL);
const gchar *label);
GtkWidget* gtk_radio_button_new_with_mnemonic_from_widget (GtkRadioButton *group,
const gchar *label);
-GSList* gtk_radio_button_group (GtkRadioButton *radio_button);
+GSList* gtk_radio_button_get_group (GtkRadioButton *radio_button);
void gtk_radio_button_set_group (GtkRadioButton *radio_button,
GSList *group);
+#ifndef GTK_DISABLE_DEPRECATED
+#define gtk_radio_button_group gtk_radio_button_get_group
+#endif
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
}
}
+/**
+ * gtk_range_get_update_policy:
+ * @range: a #GtkRange
+ *
+ * Gets the update policy of @range. See gtk_range_set_update_policy().
+ *
+ * Return value: the current update policy
+ **/
+GtkUpdateType
+gtk_range_get_update_policy (GtkRange *range)
+{
+ g_return_val_if_fail (GTK_IS_RANGE (range), GTK_UPDATE_CONTINUOUS);
+
+ return range->update_policy;
+}
+
/**
* gtk_range_set_adjustment:
* @range: a #GtkRange
void gtk_range_set_update_policy (GtkRange *range,
GtkUpdateType policy);
+GtkUpdateType gtk_range_get_update_policy (GtkRange *range);
void gtk_range_set_adjustment (GtkRange *range,
GtkAdjustment *adjustment);
GtkAdjustment* gtk_range_get_adjustment (GtkRange *range);
gtk_widget_queue_draw (GTK_WIDGET (ruler));
}
+/**
+ * gtk_ruler_get_metric:
+ * @ruler: a #GtkRuler
+ *
+ * Gets the units used for a #GtkRule . See gtk_ruler_set_metric().
+ *
+ * Return value: the units currently used for @ruler
+ **/
+GtkMetricType
+gtk_ruler_get_metric (GtkRuler *ruler)
+{
+ gint i;
+
+ g_return_val_if_fail (GTK_IS_RULER (ruler), 0);
+
+ for (i = 0; i < G_N_ELEMENTS (ruler_metrics); i++)
+ if (ruler->metric == &ruler_metrics[i])
+ return i;
+
+ g_assert_not_reached ();
+
+ return 0;
+}
+
void
gtk_ruler_set_range (GtkRuler *ruler,
gdouble lower,
gtk_widget_queue_draw (GTK_WIDGET (ruler));
}
+/**
+ * gtk_ruler_get_range:
+ * @ruler: a #GtkRuler
+ * @lower: location to store lower limit of the ruler, or %NULL
+ * @upper: location to store upper limit of the ruler, or %NULL
+ * @position: location to store the current position of the mark on the ruler, or %NULL
+ * @max_size: location to store the maximum size of the ruler used when calculating
+ * the space to leave for the text, or %NULL.
+ *
+ * Retrieves values indicating the range and current position of a #GtkRuler.
+ * See gtk_ruler_set_range().
+ **/
+void
+gtk_ruler_get_range (GtkRuler *ruler,
+ gdouble *lower,
+ gdouble *upper,
+ gdouble *position,
+ gdouble *max_size)
+{
+ g_return_if_fail (GTK_IS_RULER (ruler));
+
+ if (lower)
+ *lower = ruler->lower;
+ if (upper)
+ *upper = ruler->upper;
+ if (position)
+ *position = ruler->position;
+ if (max_size)
+ *max_size = ruler->max_size;
+}
+
void
gtk_ruler_draw_ticks (GtkRuler *ruler)
{
void gtk_ruler_draw_ticks (GtkRuler *ruler);
void gtk_ruler_draw_pos (GtkRuler *ruler);
+GtkMetricType gtk_ruler_get_metric (GtkRuler *ruler);
+void gtk_ruler_get_range (GtkRuler *ruler,
+ gdouble *lower,
+ gdouble *upper,
+ gdouble *position,
+ gdouble *max_size);
#ifdef __cplusplus
}
}
}
+/**
+ * gtk_scrolled_window_get_policy:
+ * @scrolled_window: a #GtkScrolledWindow
+ * @hscrollbar_policy: location to store the policy for the horizontal scrollbar, or %NULL.
+ * @vscrollbar_policy: location to store the policy for the horizontal scrollbar, or %NULL.
+ *
+ * Retrieves the current policy values for the horizontal and vertical
+ * scrollbars. See gtk_scrolled_window_set_policy().
+ **/
+void
+gtk_scrolled_window_get_policy (GtkScrolledWindow *scrolled_window,
+ GtkPolicyType *hscrollbar_policy,
+ GtkPolicyType *vscrollbar_policy)
+{
+ g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
+
+ if (hscrollbar_policy)
+ *hscrollbar_policy = scrolled_window->hscrollbar_policy;
+ if (vscrollbar_policy)
+ *vscrollbar_policy = scrolled_window->vscrollbar_policy;
+}
+
void
gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window,
GtkCornerType window_placement)
}
}
+/**
+ * gtk_scrolled_window_get_placement:
+ * @scrolled_window: a #GtkScrolledWindow
+ *
+ * Gets the placement of the scrollbars for the scrolled window. See
+ * gtk_scrolled_window_set_placement().
+ *
+ * Return value: the current placement value.
+ **/
+GtkCornerType
+gtk_scrolled_window_get_placement (GtkScrolledWindow *scrolled_window)
+{
+ g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window), GTK_CORNER_TOP_LEFT);
+
+ return scrolled_window->window_placement;
+}
+
/**
* gtk_scrolled_window_set_shadow_type:
* @scrolled_window: a #GtkScrolledWindow
}
}
+/**
+ * gtk_scrolled_window_get_shadow_type:
+ * @scrolled_window: a #GtkScrolledWindow
+ *
+ * Gets the shadow type of the scrolled window. See
+ * gtk_scrolled_window_set_shadow_type().
+ *
+ * Return value: the current shadow type
+ **/
+GtkShadowType
+gtk_scrolled_window_get_shadow_type (GtkScrolledWindow *scrolled_window)
+{
+ g_return_val_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_NONE);
+
+ return scrolled_window->shadow_type;
+}
+
static void
gtk_scrolled_window_destroy (GtkObject *object)
{
void gtk_scrolled_window_set_policy (GtkScrolledWindow *scrolled_window,
GtkPolicyType hscrollbar_policy,
GtkPolicyType vscrollbar_policy);
+void gtk_scrolled_window_get_policy (GtkScrolledWindow *scrolled_window,
+ GtkPolicyType *hscrollbar_policy,
+ GtkPolicyType *vscrollvar_policy);
void gtk_scrolled_window_set_placement (GtkScrolledWindow *scrolled_window,
GtkCornerType window_placement);
+GtkCornerType gtk_scrolled_window_get_placement (GtkScrolledWindow *scrolled_window);
void gtk_scrolled_window_set_shadow_type (GtkScrolledWindow *scrolled_window,
GtkShadowType type);
+GtkShadowType gtk_scrolled_window_get_shadow_type (GtkScrolledWindow *scrolled_window);
void gtk_scrolled_window_add_with_viewport (GtkScrolledWindow *scrolled_window,
GtkWidget *child);
}
}
+/**
+ * gtk_spin_button_get_digits:
+ * @spin_button: a #GtkSpinButton
+ *
+ * Fetches the precision of @spin_button. See gtk_spin_button_set_digits().
+ *
+ * Returns: the current precision
+ **/
+guint
+gtk_spin_button_get_digits (GtkSpinButton *spin_button)
+{
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), 0);
+
+ return spin_button->digits;
+}
+
/**
* gtk_spin_button_set_increments:
* @spin_button: a #GtkSpinButton
spin_button->adjustment->page_increment = page;
}
+/**
+ * gtk_spin_button_get_increments:
+ * @psin_button: a #GtkSpinButton
+ * @step: location to store step increment, or %NULL
+ * @page: location to store page increment, or %NULL
+ *
+ * Gets the current step and page the increments used by @spin_button. See
+ * gtk_spin_button_set_increments().
+ **/
+void
+gtk_spin_button_get_increments (GtkSpinButton *spin_button,
+ gdouble *step,
+ gdouble *page)
+{
+ g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
+
+ if (step)
+ *step = spin_button->adjustment->step_increment;
+ if (page)
+ *page = spin_button->adjustment->page_increment;
+}
+
/**
* gtk_spin_button_set_range:
* @spin_button: a #GtkSpinButton
gtk_adjustment_changed (spin_button->adjustment);
}
+/**
+ * gtk_spin_button_get_range:
+ * @spin_button: a #GtkSpinButton
+ * @min: location to store minimum allowed value, or %NULL
+ * @max: location to store maximum allowed value, or %NULL
+ *
+ * Gets the range allowed for @spin_button. See
+ * gtk_spin_button_set_range().
+ **/
+void
+gtk_spin_button_get_range (GtkSpinButton *spin_button,
+ gdouble *min,
+ gdouble *max)
+{
+ g_return_if_fail (GTK_IS_SPIN_BUTTON (spin_button));
+
+ if (min)
+ *min = spin_button->adjustment->lower;
+ if (max)
+ *max = spin_button->adjustment->upper;
+}
+
/**
* gtk_spin_button_get_value:
* @spin_button: a #GtkSpinButton
}
}
+/**
+ * gtk_spin_button_get_update_policy:
+ * @spin_button: a #GtkSpinButton
+ *
+ * Gets the update behavior of a spin button. See
+ * gtk_spin_button_set_update_policy().
+ *
+ * Return value: the current update policy
+ **/
+GtkSpinButtonUpdatePolicy
+gtk_spin_button_get_update_policy (GtkSpinButton *spin_button)
+{
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), GTK_UPDATE_ALWAYS);
+
+ return spin_button->update_policy;
+}
+
/**
* gtk_spin_button_set_numeric:
* @spin_button: a #GtkSpinButton
g_object_notify (G_OBJECT (spin_button), "numeric");
}
+/**
+ * gtk_spin_button_get_numeric:
+ * @spin_button: a #GtkSpinButton
+ *
+ * Returns whether non-numeric text can be typed into the spin button.
+ * See gtk_spin_button_set_numeric().
+ *
+ * Return value: %TRUE if only numeric text can be entered
+ **/
+gboolean
+gtk_spin_button_get_numeric (GtkSpinButton *spin_button)
+{
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
+
+ return spin_button->numeric;
+}
+
/**
* gtk_spin_button_set_wrap:
* @spin_button: a #GtkSpinButton
g_object_notify (G_OBJECT (spin_button), "wrap");
}
+/**
+ * gtk_spin_button_get_wrap:
+ * @spin_button: a #GtkSpinButton
+ *
+ * Returns whether the spin button's value wraps around to the
+ * opposite limit when the upper or lower limit of the range is
+ * exceeded. See gtk_spin_button_set_wrap().
+ *
+ * Return value: %TRUE if the spin button wraps around
+ **/
+gboolean
+gtk_spin_button_get_wrap (GtkSpinButton *spin_button)
+{
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
+
+ return spin_button->wrap;
+}
+
/**
* spin_button_get_shadow_type:
* @spin_button: a #GtkSpinButton
}
}
+/**
+ * gtk_spin_button_get_snap_to_ticks:
+ * @spin_button: a #GtkSpinButton
+ *
+ * Returns whether the values are corrected to the nearest step. See
+ * gtk_spin_button_set_snap_to_ticks().
+ *
+ * Return value: %TRUE if values are snapped to the nearest step.
+ **/
+gboolean
+gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button)
+{
+ g_return_val_if_fail (GTK_IS_SPIN_BUTTON (spin_button), FALSE);
+
+ return spin_button->snap_to_ticks;
+}
+
/**
* gtk_spin_button_spin:
* @spin_button: a #GtkSpinButton
void gtk_spin_button_set_digits (GtkSpinButton *spin_button,
guint digits);
+guint gtk_spin_button_get_digits (GtkSpinButton *spin_button);
void gtk_spin_button_set_increments (GtkSpinButton *spin_button,
gdouble step,
gdouble page);
+void gtk_spin_button_get_increments (GtkSpinButton *spin_button,
+ gdouble *step,
+ gdouble *page);
void gtk_spin_button_set_range (GtkSpinButton *spin_button,
gdouble min,
gdouble max);
+void gtk_spin_button_get_range (GtkSpinButton *spin_button,
+ gdouble *min,
+ gdouble *max);
gdouble gtk_spin_button_get_value (GtkSpinButton *spin_button);
void gtk_spin_button_set_update_policy (GtkSpinButton *spin_button,
GtkSpinButtonUpdatePolicy policy);
+GtkSpinButtonUpdatePolicy gtk_spin_button_get_update_policy (GtkSpinButton *spin_button);
void gtk_spin_button_set_numeric (GtkSpinButton *spin_button,
gboolean numeric);
+gboolean gtk_spin_button_get_numeric (GtkSpinButton *spin_button);
void gtk_spin_button_spin (GtkSpinButton *spin_button,
GtkSpinType direction,
void gtk_spin_button_set_wrap (GtkSpinButton *spin_button,
gboolean wrap);
+gboolean gtk_spin_button_get_wrap (GtkSpinButton *spin_button);
void gtk_spin_button_set_snap_to_ticks (GtkSpinButton *spin_button,
gboolean snap_to_ticks);
+gboolean gtk_spin_button_get_snap_to_ticks (GtkSpinButton *spin_button);
void gtk_spin_button_update (GtkSpinButton *spin_button);
g_object_notify (G_OBJECT (table), "row_spacing");
}
+/**
+ * gtk_table_get_row_spacing:
+ * @table: a #GtkTable
+ * @row: a row in the table, 0 indicates the first row
+ *
+ * Gets the amount of space between row @row, and
+ * row @row + 1. See gtk_table_set_row_spacing().
+ *
+ * Return value: the row spacing
+ **/
+guint
+gtk_table_get_row_spacing (GtkTable *table,
+ guint row)
+{
+ g_return_val_if_fail (GTK_IS_TABLE (table), 0);
+ g_return_val_if_fail (row < table->nrows - 1, 0);
+
+ return table->rows[row].spacing;
+}
+
void
gtk_table_set_col_spacing (GtkTable *table,
guint column,
g_object_notify (G_OBJECT (table), "column_spacing");
}
+/**
+ * gtk_table_get_col_spacing:
+ * @table: a #GtkTable
+ * @col: a column in the table, 0 indicates the first column
+ *
+ * Gets the amount of space between column @col, and
+ * column @col + 1. See gtk_table_set_col_spacing().
+ *
+ * Return value: the column spacing
+ **/
+guint
+gtk_table_get_col_spacing (GtkTable *table,
+ guint column)
+{
+ g_return_val_if_fail (GTK_IS_TABLE (table), 0);
+ g_return_val_if_fail (column < table->ncols, 0);
+
+ return table->cols[column].spacing;
+}
+
void
gtk_table_set_row_spacings (GtkTable *table,
guint spacing)
gtk_widget_queue_resize (GTK_WIDGET (table));
}
+/**
+ * gtk_table_get_default_row_spacing:
+ * @table: a #GtkTable
+ *
+ * Gets the default row spacing for the table. This is
+ * the spacing that will be used for newly added rows.
+ * (See gtk_table_set_row_spacings())
+ *
+ * Returns value: the default row spacing
+ **/
+guint
+gtk_table_get_default_row_spacing (GtkTable *table)
+{
+ g_return_val_if_fail (GTK_IS_TABLE (table), 0);
+
+ return table->row_spacing;
+}
+
void
gtk_table_set_col_spacings (GtkTable *table,
guint spacing)
gtk_widget_queue_resize (GTK_WIDGET (table));
}
+/**
+ * gtk_table_get_default_col_spacing:
+ * @table: a #GtkTable
+ *
+ * Gets the default column spacing for the table. This is
+ * the spacing that will be used for newly added columns.
+ * (See gtk_table_set_col_spacings())
+ *
+ * Returns value: the default column spacing
+ **/
+guint
+gtk_table_get_default_col_spacing (GtkTable *table)
+{
+ g_return_val_if_fail (GTK_IS_TABLE (table), 0);
+
+ return table->column_spacing;
+}
+
void
gtk_table_set_homogeneous (GtkTable *table,
gboolean homogeneous)
}
}
+/**
+ * gtk_table_get_homogeneous:
+ * @table: a #GtkTable
+ *
+ * Returns whether the table cells are all constrained to the same
+ * width and height. (See gtk_table_set_homogenous ())
+ *
+ * Return value: %TRUE if the cells are all constrained to the same size
+ **/
+gboolean
+gtk_table_get_homogeneous (GtkTable *table)
+{
+ g_return_val_if_fail (GTK_IS_TABLE (table), FALSE);
+
+ return table->homogeneous;
+}
+
static void
gtk_table_finalize (GObject *object)
{
void gtk_table_set_row_spacing (GtkTable *table,
guint row,
guint spacing);
+guint gtk_table_get_row_spacing (GtkTable *table,
+ guint row);
void gtk_table_set_col_spacing (GtkTable *table,
guint column,
guint spacing);
+guint gtk_table_get_col_spacing (GtkTable *table,
+ guint column);
void gtk_table_set_row_spacings (GtkTable *table,
guint spacing);
+guint gtk_table_get_default_row_spacing (GtkTable *table);
void gtk_table_set_col_spacings (GtkTable *table,
guint spacing);
+guint gtk_table_get_default_col_spacing (GtkTable *table);
void gtk_table_set_homogeneous (GtkTable *table,
gboolean homogeneous);
+gboolean gtk_table_get_homogeneous (GtkTable *table);
#ifdef __cplusplus
}
}
+/**
+ * gtk_text_layout_get_buffer:
+ * @layout: a #GtkTextLayout
+ *
+ * Gets the text buffer used by the layout. See
+ * gtk_text_layout_set_buffer().
+ *
+ * Return value: the text buffer used by the layout.
+ **/
+GtkTextBuffer *
+gtk_text_layout_get_buffer (GtkTextLayout *layout)
+{
+ g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), NULL);
+
+ return layout->buffer;
+}
+
void
gtk_text_layout_set_screen_width (GtkTextLayout *layout, gint width)
{
extern PangoAttrType gtk_text_attr_appearance_type;
GType gtk_text_layout_get_type (void) G_GNUC_CONST;
-GtkTextLayout* gtk_text_layout_new (void);
-void gtk_text_layout_set_buffer (GtkTextLayout *layout,
- GtkTextBuffer *buffer);
-void gtk_text_layout_set_default_style (GtkTextLayout *layout,
- GtkTextAttributes *values);
-void gtk_text_layout_set_contexts (GtkTextLayout *layout,
- PangoContext *ltr_context,
- PangoContext *rtl_context);
-void gtk_text_layout_set_cursor_direction (GtkTextLayout *layout,
- GtkTextDirection direction);
-void gtk_text_layout_default_style_changed (GtkTextLayout *layout);
-
+
+GtkTextLayout* gtk_text_layout_new (void);
+void gtk_text_layout_set_buffer (GtkTextLayout *layout,
+ GtkTextBuffer *buffer);
+GtkTextBuffer *gtk_text_layout_get_buffer (GtkTextLayout *layout);
+void gtk_text_layout_set_default_style (GtkTextLayout *layout,
+ GtkTextAttributes *values);
+void gtk_text_layout_set_contexts (GtkTextLayout *layout,
+ PangoContext *ltr_context,
+ PangoContext *rtl_context);
+void gtk_text_layout_set_cursor_direction (GtkTextLayout *layout,
+ GtkTextDirection direction);
+void gtk_text_layout_default_style_changed (GtkTextLayout *layout);
+
void gtk_text_layout_set_screen_width (GtkTextLayout *layout,
gint width);
void gtk_text_layout_set_preedit_string (GtkTextLayout *layout,
break;
default:
- g_warning ("Can't set size of center or widget or private GtkTextWindowType in %s", G_STRLOC);
+ g_warning ("Can only set size of left/right/top/bottom border windows with gtk_text_view_set_border_window_size in %s\n", G_STRLOC);
break;
}
}
+/**
+ * gtk_text_view_get_border_window_size:
+ * @text_view: a #GtkTextView
+ * @type: window to return size from
+ *
+ * Gets the width of the specified border window. See
+ * gtk_text_view_set_border_window_size().
+ *
+ * Return value: width of window
+ **/
+gint
+gtk_text_view_get_border_window_size (GtkTextView *text_view,
+ GtkTextWindowType type)
+{
+ g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), 0);
+ g_return_val_if_fail (type != GTK_TEXT_WINDOW_WIDGET, 0);
+ g_return_val_if_fail (type != GTK_TEXT_WINDOW_TEXT, 0);
+
+ switch (type)
+ {
+ case GTK_TEXT_WINDOW_LEFT:
+ return text_view->left_window->requisition.width;
+
+ case GTK_TEXT_WINDOW_RIGHT:
+ return text_view->right_window->requisition.width;
+
+ case GTK_TEXT_WINDOW_TOP:
+ return text_view->top_window->requisition.height;
+
+ case GTK_TEXT_WINDOW_BOTTOM:
+ return text_view->bottom_window->requisition.height;
+
+ default:
+ g_warning ("Can only get size of left/right/top/bottom border windows with gtk_text_view_get_border_window_size in %s\n", G_STRLOC);
+ break;
+ }
+
+ return 0;
+}
+
/**
* gtk_text_view_set_text_window_size:
* @text_view: a #GtkTextView
void gtk_text_view_set_border_window_size (GtkTextView *text_view,
GtkTextWindowType type,
gint size);
+gint gtk_text_view_get_border_window_size (GtkTextView *text_view,
+ GtkTextWindowType type);
void gtk_text_view_set_text_window_size (GtkTextView *text_view,
gint width,
gint height);
}
}
+/**
+ * gtk_toggle_button_get_mode:
+ * @toggle_button: a #GtkToggleButton
+ *
+ * Retrieves whether the button is displayed as a separate indicator
+ * and label. See gtk_toggle_button_set_mode().
+ *
+ * Return value: %TRUE if the togglebutton is drawn as a separate indicator
+ * and label.
+ **/
+gboolean
+gtk_toggle_button_get_mode (GtkToggleButton *toggle_button)
+{
+ g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (toggle_button), FALSE);
+
+ return toggle_button->draw_indicator;
+}
void
gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
GtkWidget* gtk_toggle_button_new_with_mnemonic (const gchar *label);
void gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
gboolean draw_indicator);
+gboolean gtk_toggle_button_get_mode (GtkToggleButton *toggle_button);
void gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
gboolean is_active);
gboolean gtk_toggle_button_get_active (GtkToggleButton *toggle_button);
gtk_widget_queue_resize (GTK_WIDGET (toolbar));
}
+/**
+ * gtk_toolbar_get_icon_size:
+ * @toolbar: a #GtkToolbar
+ *
+ * Retrieves the icon size fo the toolbar. See gtk_toolbar_set_icon_size().
+ *
+ * Return value: the current icon size for the icons on the toolbar.
+ **/
+GtkIconSize
+gtk_toolbar_get_icon_size (GtkToolbar *toolbar)
+{
+ g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_ICON_SIZE_LARGE_TOOLBAR);
+
+ return toolbar->icon_size;
+}
+
/**
* gtk_toolbar_unset_icon_size:
* @toolbar: a #GtkToolbar
else
{
child->widget = gtk_radio_button_new (widget
- ? gtk_radio_button_group (GTK_RADIO_BUTTON (widget))
+ ? gtk_radio_button_get_group (GTK_RADIO_BUTTON (widget))
: NULL);
gtk_button_set_relief (GTK_BUTTON (child->widget), get_button_relief (toolbar));
gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (child->widget), FALSE);
gtk_signal_emit (GTK_OBJECT (toolbar), toolbar_signals[ORIENTATION_CHANGED], orientation);
}
+/**
+ * gtk_toolbar_get_orientation:
+ * @toolbar: a #GtkToolbar
+ *
+ * Retrieves the current orientation of the toolbar. See
+ * gtk_toolbar_set_orientation().
+ *
+ * Return value: the orientation
+ **/
+GtkOrientation
+gtk_toolbar_get_orientation (GtkToolbar *toolbar)
+{
+ g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_ORIENTATION_HORIZONTAL);
+
+ return toolbar->orientation;
+}
+
void
gtk_toolbar_set_style (GtkToolbar *toolbar,
GtkToolbarStyle style)
gtk_signal_emit (GTK_OBJECT (toolbar), toolbar_signals[STYLE_CHANGED], style);
}
+/**
+ * gtk_toolbar_get_style:
+ * @toolbar: a #GtkToolbar
+ *
+ * Retrieves whether the toolbar has text, icons, or both . See
+ * gtk_toolbar_set_style().
+
+ * Return value: the current style of @toolbar
+ **/
+GtkToolbarStyle
+gtk_toolbar_get_style (GtkToolbar *toolbar)
+{
+ g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), GTK_TOOLBAR_BOTH);
+
+ return toolbar->style;
+}
+
/**
* gtk_toolbar_unset_style:
* @toolbar: a #GtkToolbar
gtk_tooltips_disable (toolbar->tooltips);
}
+/**
+ * gtk_toolbar_get_tooltips:
+ * @toolbar: a #GtkToolbar
+ *
+ * Retrieves whether tooltips are enabled. See
+ * gtk_toolbar_set_tooltips().
+ *
+ * Return value: %TRUE if tooltips are enabled
+ **/
+gboolean
+gtk_toolbar_get_tooltips (GtkToolbar *toolbar)
+{
+ g_return_val_if_fail (GTK_IS_TOOLBAR (toolbar), FALSE);
+
+ return toolbar->tooltips->enabled;
+}
+
static void
gtk_toolbar_update_button_relief (GtkToolbar *toolbar)
{
void gtk_toolbar_unset_style (GtkToolbar *toolbar);
void gtk_toolbar_unset_icon_size (GtkToolbar *toolbar);
+GtkOrientation gtk_toolbar_get_orientation (GtkToolbar *toolbar);
+GtkToolbarStyle gtk_toolbar_get_style (GtkToolbar *toolbar);
+GtkIconSize gtk_toolbar_get_icon_size (GtkToolbar *toolbar);
+gboolean gtk_toolbar_get_tooltips (GtkToolbar *toolbar);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
/**
* gtk_tree_selection_set_mode:
* @selection: A #GtkTreeSelection.
- * @type: The selection type.
+ * @type: The selection mode
*
- * Sets the selection type of the @selection. If the previous type was
+ * Sets the selection mode of the @selection. If the previous type was
* #GTK_TREE_SELECTION_MULTI and @type is #GTK_TREE_SELECTION_SINGLE, then
* the anchor is kept selected, if it was previously selected.
**/
selection->type = type;
}
+/**
+ * gtk_tree_selection_get_mode:
+ * @selection: a #GtkTreeSelection
+ *
+ * Gets the selection mode for @selection. See
+ * gtk_tree_selection_set_mode().
+ *
+ * Return value: the current selection mode
+ **/
+GtkTreeSelectionMode
+gtk_tree_selection_get_mode (GtkTreeSelection *selection)
+{
+ g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), GTK_TREE_SELECTION_SINGLE);
+
+ return selection->type;
+}
+
/**
* gtk_tree_selection_set_select_function:
* @selection: A #GtkTreeSelection.
void gtk_tree_selection_set_mode (GtkTreeSelection *selection,
GtkTreeSelectionMode type);
+GtkTreeSelectionMode gtk_tree_selection_get_mode (GtkTreeSelection *selection);
void gtk_tree_selection_set_select_function (GtkTreeSelection *selection,
GtkTreeSelectionFunc func,
gpointer data,
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_WIDGET, 0 }
};
+
+/**
+ * gtk_tree_view_get_reorderable:
+ * @tree_view: a #GtkTreeView
+ *
+ * Retrieves whether the user can reorder the tree via drag-and-drop. See
+ * gtk_tree_view_set_reorderable().
+ *
+ * Return value: %TRUE if the tree can be reordered.
+ **/
+gboolean
+gtk_tree_view_get_reorderable (GtkTreeView *tree_view)
+{
+ g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), FALSE);
+
+ return tree_view->priv->reorderable;
+}
+
/**
* gtk_tree_view_set_reorderable:
* @tree_view: A #GtkTreeView.
GtkTreePath *path);
void gtk_tree_view_set_reorderable (GtkTreeView *tree_view,
gboolean reorderable);
+gboolean gtk_tree_view_get_reorderable (GtkTreeView *tree_view);
void gtk_tree_view_set_cursor (GtkTreeView *tree_view,
GtkTreePath *path);
* @tree_column: a #GtkTreeViewColumn
* @sort_column_id: The sort_column_id of the model to sort on.
*
- * Sets the sort_column_id that the column sorts on. Doing so makes headers
- * clickable.
+ * Sets the logical sort_column_id that this column sorts on when this
+ * column is selected for sorting. Doing so makes
+ * the column header clickable.
**/
void
gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
gtk_tree_view_column_setup_sort_column_id_callback (tree_column);
}
+/**
+ * gtk_tree_view_column_get_sort_column_id:
+ * @tree_column: a #GtkTreeViewColumn
+ *
+ * Gets the logical sort_column_id that the model sorts on when this
+ * coumn is selected for sorting. See gtk_tree_view_column_set_sort_column_id().
+ *
+ * Return value: the current sort_column_id for this column, or -1 if
+ * this column can't be used for sorting.
+ **/
+gint
+gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column)
+{
+ g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), 0);
+
+ return tree_column->sort_column_id;
+}
+
/**
* gtk_tree_view_column_set_sort_indicator:
* @tree_column: a #GtkTreeViewColumn
*/
void gtk_tree_view_column_set_sort_column_id (GtkTreeViewColumn *tree_column,
gint sort_column_id);
+gint gtk_tree_view_column_get_sort_column_id (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_sort_indicator (GtkTreeViewColumn *tree_column,
gboolean setting);
gboolean gtk_tree_view_column_get_sort_indicator (GtkTreeViewColumn *tree_column);
g_object_notify (G_OBJECT (viewport), "shadow_type");
}
+/**
+ * gtk_viewport_get_shadow_type:
+ * @viewport: a #GtkViewport
+ *
+ * Gets the shadow type of the #GtkViewport. See
+ * gtk_viewport_set_shadow_type().
+
+ * Return value: the shadow type
+ **/
+GtkShadowType
+gtk_viewport_get_shadow_type (GtkViewport *viewport)
+{
+ g_return_val_if_fail (GTK_IS_VIEWPORT (viewport), GTK_SHADOW_NONE);
+
+ return viewport->shadow_type;
+}
static void
gtk_viewport_map (GtkWidget *widget)
GtkAdjustment *adjustment);
void gtk_viewport_set_shadow_type (GtkViewport *viewport,
GtkShadowType type);
+GtkShadowType gtk_viewport_get_shadow_type (GtkViewport *viewport);
#ifdef __cplusplus
g_object_notify (G_OBJECT (widget), "parent");
}
+/**
+ * gtk_widget_get_parent:
+ * @widget: a #GtkWidget
+ *
+ * Returns the parent container of @widget.
+ *
+ * Return value: the parent container of @widget, or %NULL
+ **/
+GtkWidget *
+gtk_widget_get_parent (GtkWidget *widget)
+{
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ return widget->parent;
+}
+
/*****************************************
* Widget styles
* see docs/styles.txt
g_object_thaw_notify (G_OBJECT (widget));
}
+/**
+ * gtk_widget_get_usize:
+ * @widget: a #GtkWidget
+ * @width: location to store the width, or %NULL
+ * @height: location to store the height, or %NULL
+ *
+ * Gets the size that has explicitely set for the widget to request,
+ * if any. A value of -1 stored in @width or @height indicates that
+ * that dimension has not been set explicitely and the natural
+ * requisition of the widget will be used intead. See
+ * gtk_widget_set_usize().
+ **/
+void
+gtk_widget_get_usize (GtkWidget *widget,
+ gint *width,
+ gint *height)
+{
+ GtkWidgetAuxInfo *aux_info;
+
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ aux_info = _gtk_widget_get_aux_info (widget, FALSE);
+
+ if (width)
+ *width = aux_info ? aux_info->width : -1;
+
+ if (height)
+ *height = aux_info ? aux_info->height : -1;
+}
+
/**
* gtk_widget_set_events:
* @widget: a #GtkWidget
GtkWidget *parent);
void gtk_widget_set_parent_window (GtkWidget *widget,
GdkWindow *parent_window);
+GtkWidget *gtk_widget_get_parent (GtkWidget *widget);
GdkWindow *gtk_widget_get_parent_window (GtkWidget *widget);
gboolean gtk_widget_child_focus (GtkWidget *widget,
GtkDirectionType direction);
void gtk_widget_set_usize (GtkWidget *widget,
gint width,
gint height);
+void gtk_widget_get_usize (GtkWidget *widget,
+ gint *width,
+ gint *height);
void gtk_widget_set_events (GtkWidget *widget,
gint events);
void gtk_widget_add_events (GtkWidget *widget,
g_object_notify (G_OBJECT (window), "title");
}
+/**
+ * gtk_window_get_title:
+ * @window: a #GtkWindow
+ *
+ * Retrieves the title of the window. See gtk_window_set_title().
+ *
+ * Return value: the title of the window, or %NULL if none has
+ * been set explicitely. The returned string is owned by the widget
+ * and must not be modified or freed.
+ **/
+G_CONST_RETURN gchar *
+gtk_window_get_title (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+
+ return window->title;
+}
+
/**
* gtk_window_set_wmclass:
* @window: a #GtkWindow
g_warning ("gtk_window_set_role(): shouldn't set role after window is realized!\n");
}
+/**
+ * gtk_window_get_role:
+ * @window: a #GtkWindow
+ *
+ * Returns the role of the window. See gtk_window_set_role() for
+ * further explanation.
+ *
+ * Return value: the role of the window if set, or %NULL. The
+ * returned is owned by the widget and must not be modified
+ * or freed.
+ **/
+G_CONST_RETURN gchar *
+gtk_window_get_role (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+
+ return window->wm_role;
+}
+
/**
* gtk_window_set_focus:
* @window: a #GtkWindow
window->mnemonic_modifier = modifier;
}
+/**
+ * gtk_window_get_mnemonic_modifier:
+ * @window: a #GtkWindow
+ *
+ * Returns the mnemonic modifier for this window. See
+ * gtk_window_set_mnemonic_modifier().
+ *
+ * Return value: the modifier mask used to activate
+ * mnemonics on this window.
+ **/
+GdkModifierType
+gtk_window_get_mnemonic_modifier (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), 0);
+
+ return window->mnemonic_modifier;
+}
+
void
gtk_window_set_position (GtkWindow *window,
GtkWindowPosition position)
g_object_notify (G_OBJECT (window), "modal");
}
+/**
+ * gtk_window_get_modal:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window is modal. See gtk_window_set_modal().
+ *
+ * Return value: %TRUE if the window is set to be modal and
+ * establishes a grab when shown
+ **/
+gboolean
+gtk_window_get_modal (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->modal;
+}
+
/**
* gtk_window_list_toplevels:
*
}
}
+/**
+ * gtk_window_get_transient_for:
+ * @window: a #GtkWindow
+ *
+ * Fetches the transient parent for this window. See
+ * gtk_window_set_transient_for().
+ *
+ * Return value: the transient parent for this window, or %NULL
+ * if no transient parent has been set.
+ **/
+GtkWindow *
+gtk_window_get_transient_for (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), NULL);
+
+ return window->transient_parent;
+}
+
/**
* gtk_window_set_type_hint:
* @window: a #GtkWindow
window->type_hint = hint;
}
+/**
+ * gtk_window_get_type_hint:
+ * @window: a #GtkWindow
+ *
+ * Gets the type hint for this window. See gtk_window_set_type_hint().
+ *
+ * Return value: the type hint for @window.
+ **/
+GdkWindowTypeHint
+gtk_window_get_type_hint (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), GDK_WINDOW_TYPE_HINT_NORMAL);
+
+ return window->type_hint;
+}
+
/**
* gtk_window_set_destroy_with_parent:
* @window: a #GtkWindow
g_object_notify (G_OBJECT (window), "destroy_with_parent");
}
+/**
+ * gtk_window_get_destroy_with_parent:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window will be destroyed with its transient parent. See
+ * gtk_window_set_destroy_with_parent ().
+ *
+ * Return value: %TRUE if the window will be destroyed with its transient parent.
+ **/
+gboolean
+gtk_window_get_destroy_with_parent (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->destroy_with_parent;
+}
+
static GtkWindowGeometryInfo*
gtk_window_get_geometry_info (GtkWindow *window,
gboolean create)
}
}
+/**
+ * gtk_window_get_decorated:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window has been set to have decorations
+ * such as a title bar via gtk_window_set_decorated().
+ *
+ * Return value: %TRUE if the window has been set to have decorations
+ **/
+gboolean
+gtk_window_get_decorated (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), TRUE);
+
+ return window->decorated;
+}
+
/**
* gtk_window_set_default_size:
* @window: a #GtkWindow
gtk_widget_queue_resize (GTK_WIDGET (window));
}
+
+/**
+ * gtk_window_get_default_size:
+ * @window: a #GtkWindow
+ * @width: location to store the default width, or %NULL
+ * @height: location to store the default height, or %NULL
+ *
+ * Gets the default size of the window. A value of 0 for the
+ * width or height indicates that a default size has not
+ * been explicitely set for that dimension, so the value
+ * will be computed from the requisition of the window.
+ **/
+void
+gtk_window_get_default_size (GtkWindow *window,
+ gint *width,
+ gint *height)
+{
+ GtkWindowGeometryInfo *info;
+
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
+ info = gtk_window_get_geometry_info (window, FALSE);
+
+ if (width)
+ *width = info ? info->width : 0;
+
+ if (height)
+ *height = info ? info->height : 0;
+}
static void
gtk_window_destroy (GtkObject *object)
*
* If this function is called on a window with setting of TRUE, before
* it is realized or showed, it will have a "frame" window around
- * widget-window, accessible in window->frame. Using the signal
+ * widget->window, accessible in window->frame. Using the signal
* frame_event you can recieve all events targeted at the frame.
*
* This function is used by the linux-fb port to implement managed
window->has_frame = setting != FALSE;
}
+/**
+ * gtk_window_get_has_frame:
+ * @window: a #GtkWindow
+ *
+ * Returns whether the window has a frame window exterior to
+ * widget->window. See gtk_window_set_has_frame ().
+ *
+ * Return value: %TRUE if a frame has been added to the window
+ * via gtk_widow_has_frame
+ **/
+gboolean
+gtk_window_get_has_frame (GtkWindow *window)
+{
+ g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
+
+ return window->has_frame;
+}
+
/**
* gtk_window_set_frame_dimensions:
* @window: a #GtkWindow that has a frame
timestamp);
}
+/**
+ * gtk_window_get_frame_dimensions:
+ * @window: a #GtkWindow
+ * @left: location to store the width of the frame at the left, or %NULL
+ * @top: location to store the height of the frame at the top, or %NULL
+ * @right: location to store the width of the frame at the returns, or %NULL
+ * @bottom: location to store the height of the frame at the bottom, or %NULL
+ *
+ * Retrieves the dimensions of the frame window for this toplevel.
+ * See gtk_window_set_has_frame(), gtk_window_set_frame_dimensions().
+ **/
+void
+gtk_window_get_frame_dimensions (GtkWindow *window,
+ gint *left,
+ gint *top,
+ gint *right,
+ gint *bottom)
+{
+ g_return_if_fail (GTK_IS_WINDOW (window));
+
+ if (left)
+ *left = window->frame_left;
+ if (top)
+ *top = window->frame_top;
+ if (right)
+ *top = window->frame_right;
+ if (bottom)
+ *top = window->frame_bottom;
+}
/**
* gtk_window_begin_move_drag:
GtkWidget* gtk_window_new (GtkWindowType type);
void gtk_window_set_title (GtkWindow *window,
const gchar *title);
+G_CONST_RETURN gchar *gtk_window_get_title (GtkWindow *window);
void gtk_window_set_wmclass (GtkWindow *window,
const gchar *wmclass_name,
const gchar *wmclass_class);
void gtk_window_set_role (GtkWindow *window,
const gchar *role);
+G_CONST_RETURN gchar *gtk_window_get_role (GtkWindow *window);
void gtk_window_add_accel_group (GtkWindow *window,
GtkAccelGroup *accel_group);
void gtk_window_remove_accel_group (GtkWindow *window,
void gtk_window_set_transient_for (GtkWindow *window,
GtkWindow *parent);
+GtkWindow *gtk_window_get_transient_for (GtkWindow *window);
void gtk_window_set_type_hint (GtkWindow *window,
GdkWindowTypeHint hint);
+GdkWindowTypeHint gtk_window_get_type_hint (GtkWindow *window);
void gtk_window_set_destroy_with_parent (GtkWindow *window,
gboolean setting);
+gboolean gtk_window_get_destroy_with_parent (GtkWindow *window);
void gtk_window_set_resizeable (GtkWindow *window,
gboolean resizeable);
/* gtk_window_set_has_frame () must be called before realizing the window_*/
void gtk_window_set_has_frame (GtkWindow *window,
gboolean setting);
+gboolean gtk_window_get_has_frame (GtkWindow *window);
void gtk_window_set_frame_dimensions (GtkWindow *window,
gint left,
gint top,
gint right,
gint bottom);
-
-void gtk_window_set_decorated (GtkWindow *window,
- gboolean setting);
+void gtk_window_get_frame_dimensions (GtkWindow *window,
+ gint *left,
+ gint *top,
+ gint *right,
+ gint *bottom);
+void gtk_window_set_decorated (GtkWindow *window,
+ gboolean setting);
+gboolean gtk_window_get_decorated (GtkWindow *window);
/* If window is set modal, input will be grabbed when show and released when hide */
void gtk_window_set_modal (GtkWindow *window,
gboolean modal);
+gboolean gtk_window_get_modal (GtkWindow *window);
GList* gtk_window_list_toplevels (void);
void gtk_window_add_mnemonic (GtkWindow *window,
GdkModifierType modifier);
void gtk_window_set_mnemonic_modifier (GtkWindow *window,
GdkModifierType modifier);
+GdkModifierType gtk_window_get_mnemonic_modifier (GtkWindow *window);
void gtk_window_present (GtkWindow *window);
void gtk_window_iconify (GtkWindow *window);
void gtk_window_set_default_size (GtkWindow *window,
gint width,
gint height);
+void gtk_window_get_default_size (GtkWindow *window,
+ gint *width,
+ gint *height);
/* Window groups
*/
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
button = gtk_radio_button_new_with_label (
- gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"button2");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
button = gtk_radio_button_new_with_label (
- gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"button3");
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
button = gtk_radio_button_new_with_label (
- gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"inconsistent");
gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (button), TRUE);
gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(box4), button, TRUE, TRUE, 0);
sTreeSampleSelection.single_button = button;
- button = gtk_radio_button_new_with_label(gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ button = gtk_radio_button_new_with_label(gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"BROWSE");
gtk_box_pack_start(GTK_BOX(box4), button, TRUE, TRUE, 0);
sTreeSampleSelection.browse_button = button;
- button = gtk_radio_button_new_with_label(gtk_radio_button_group (GTK_RADIO_BUTTON (button)),
+ button = gtk_radio_button_new_with_label(gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
"MULTIPLE");
gtk_box_pack_start(GTK_BOX(box4), button, TRUE, TRUE, 0);
sTreeSampleSelection.multiple_button = button;
- sTreeSampleSelection.selection_mode_group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
+ sTreeSampleSelection.selection_mode_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (button));
/* create option mode frame */
frame = gtk_frame_new("Options");